import {request} from "../request";
import {utils} from "../../common/utils";
import store from "../../store";

export function queryUserCollectContact(){
	return request({
		url: '/sys/contacts-group-detail/query',
		method: 'get',
		params: {
			empId: store.state.loginUser.id
		}
	})
}

export function addUserCollectContact({groupId,empIds}){
	return request({
		url: '/sys/contacts-group-detail/add',
		method: 'post',
		data:{
			groupId,
			empIds
		}
	})
}

export function removeCollectGroupContacts(ids){
	let strUrl = utils.joinArrayReqParam(ids,'ids');
	return request({
		url: '/sys/contacts-group-detail/delete' + strUrl,
		method: 'delete'
	})
}

export function queryJoinedGroup(targetEmpId){
	return request({
		url: '/sys/contacts-group-detail/joined-group',
		method: 'get',
		params: {
			empId: store.state.loginUser.id,
			targetEmpId
		}
	})
}